package headfirst.factory.pizzastore;

import headfirst.factory.pizza.CheesePizza;
import headfirst.factory.pizza.ClamPizza;
import headfirst.factory.pizza.MeatPizza;
import headfirst.factory.pizza.PepperoniPizza;
import headfirst.factory.pizza.Pizza;
import headfirst.factory.pizza.VeggiePizza;
import headfirst.factory.topingfactory.ChicagoPizzaToppingFactory;
import headfirst.factory.topingfactory.PizzaToppingFactory;

public class ChicagoPizzaStore extends PizzaStore {

	protected Pizza createPizza(String item) {
		Pizza pizza = null;
		PizzaToppingFactory ingredientFactory =
		new ChicagoPizzaToppingFactory();

		if (item.equals("cheese")) {

			pizza = new CheesePizza(ingredientFactory);
			pizza.setName("Chicago Style Cheese Pizza");

		} else if (item.equals("veggie")) {

			pizza = new VeggiePizza(ingredientFactory);
			pizza.setName("Chicago Style Veggie Pizza");

		} else if (item.equals("clam")) {

			pizza = new ClamPizza(ingredientFactory);
			pizza.setName("Chicago Style Clam Pizza");

		} else if (item.equals("pepperoni")) {

			pizza = new PepperoniPizza(ingredientFactory);
			pizza.setName("Chicago Style Pepperoni Pizza");

		}
		else if (item.equals("meat")) {

			pizza = new MeatPizza(ingredientFactory);
			pizza.setName("Chicago Style Meat Pizza");

		}
		return pizza;
	}
}
